/**
 *@ProjectName  StudentScoreManagement
 *@version      6.0
 *@author       李一凡
 *@date         2018/5/14
 */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define MAX_NUMBER 30
#define MAX_NAME_LENGTH 20
#define true 1
#define false 0
#define boolean int

enum
{
    Excellent = 1,Well = 2,Medium = 3,Pass = 4,Fail = 5
};

enum
{
    Subject_1 = 0,Subject_2 = 1,Subject_3 = 2,Subject_4 = 3,Subject_5 = 4,Subject_6 = 5
};
/*
    定义学生结构
*/
struct Student
{
    int id;
    char name[MAX_NAME_LENGTH];
    double score[6];
    double total;
    double average;
};
/*
    定义链表
*/
typedef struct node
{
    struct Student aStudent;
    struct node* Next;
} Node;

Node* node_head = NULL;

int NumberOfStudents = 0;
int NumberOfSubjects = 0;

void FirstPage();
void Input();       //创建链表并向链表中录入信息
void CaclEverySubject();        //计算每门科目的总分和平均分
void CaclEveryStudent();        //计算每个学生的总分和平均分
Node *Sort(Node*,boolean (*comparator)(double,double));
Node *SortByNumber(Node*);
Node *SortByName(Node*);
boolean Ascending(double,double);
boolean Descending(double,double);
void SearchByNumber();
void SearchByName();
void Statistic();
void ListRecord();
void Write();
void Read();
void DeleteLinkList();

int main()
{
    system("color 0E");
    while(true)
    {
        FirstPage();
    }
    return 0;
}

void FirstPage()
{
    printf("1.Input record\n");
    printf("2.Calculate total and average score of every course\n");
    printf("3.Calculate total and average score of every student\n");
    printf("4.Sort in descending order by total score of every student\n");
    printf("5.Sort in ascending order by total score of every student\n");
    printf("6.Sort in ascending order by number\n");
    printf("7.Sort in ascending order by name\n");
    printf("8.Search by number\n");
    printf("9.Search by name\n");
    printf("10.Statistic analysis for every course\n");
    printf("11.List record\n");
    printf("12.Write to a file\n");
    printf("13.Read from a file\n");
    printf("0.exit\n");
    printf("Please enter your choice\n");

    int choice;
    scanf("%d",&choice);
    switch(choice)
    {
    case 1:
        system("cls");
        printf("请输入要录入的学生人数（小于30）:\n");
        scanf("%d",&NumberOfStudents);
        printf("请输入要录入的课程的门数（小于6）:\n");
        scanf("%d",&NumberOfSubjects);
        int i = 0;
        for(i = 0; i < NumberOfStudents; i++)
        {
            Input();
        }
        CaclEveryStudent();
        break;
    case 2:
        system("cls");
        CaclEverySubject();
        break;
    case 3:
        system("cls");
        CaclEveryStudent();
        ListRecord();
        break;
    case 4:
        system("cls");
        node_head = Sort(node_head,Descending);
        ListRecord();
        break;
    case 5:
        system("cls");
        node_head = Sort(node_head,Ascending);
        ListRecord();
        break;
    case 6:
        system("cls");
        node_head = SortByNumber(node_head);
        ListRecord();
        break;
    case 7:
        system("cls");
        node_head = SortByName(node_head);
        ListRecord();
        break;
    case 8:
        system("cls");
        SearchByNumber();
        break;
    case 9:
        system("cls");
        SearchByName();
        break;
    case 10:
        system("cls");
        CaclEverySubject();
        Statistic();
        break;
    case 11:
        system("cls");
        ListRecord();
        break;
    case 12:
        system("cls");
        Write();
        break;
    case 13:
        system("cls");
        Read();
        break;
    case 0:
        exit(0);
        break;
    default:
        printf("输入错误，请重新输入！\n");
        break;

    }
}

void Input()
{
    system("cls");
    //链表创建部分
    Node *p = node_head;
    int i,k;
    while(node_head != NULL && p->Next != NULL)
    {
        p = p->Next;
    }
    Node *StudentToInput = (Node*)malloc(sizeof(Node));
    StudentToInput->Next = NULL;

    if(node_head == NULL)
    {
        node_head = StudentToInput;
    }
    else
    {
        p->Next = StudentToInput;
        p = p->Next;
    }
    //输入部分
    printf("请输入学生学号:\n");
    scanf("%d",&StudentToInput->aStudent.id);
    fflush(stdin);
    printf("请输入学生姓名:\n");
    scanf("%s",StudentToInput->aStudent.name);
    fflush(stdin);

    for(i = 0;i < NumberOfSubjects;i++)
    {
        printf("请输入科目%d的成绩:\n",(i + 1));
        scanf("%lf",&StudentToInput->aStudent.score[i]);
    }
    for(k = NumberOfSubjects;k < 6;k++)
    {
        StudentToInput->aStudent.score[k] = 0;
    }

    printf("录入成功！\n");
}

void CaclEverySubject()
{
    system("cls");
    if(node_head == NULL)
    {
        printf("找不到学生信息，请先输入!\n");
        return;
    }
    int i;
    Node *p = node_head;
    double EverySubjectTotal[6] = {0.0};
    while(p != NULL)
    {
        EverySubjectTotal[Subject_1] += p->aStudent.score[Subject_1];
        EverySubjectTotal[Subject_2] += p->aStudent.score[Subject_2];
        EverySubjectTotal[Subject_3] += p->aStudent.score[Subject_3];
        EverySubjectTotal[Subject_4] += p->aStudent.score[Subject_4];
        EverySubjectTotal[Subject_5] += p->aStudent.score[Subject_5];
        EverySubjectTotal[Subject_6] += p->aStudent.score[Subject_6];
        p = p->Next;
    }
    for(i = 0;i < NumberOfSubjects;i++)
    {
        printf("科目%d总分为:%.2lf,平均分为:%.2lf\n",i + 1,EverySubjectTotal[i],EverySubjectTotal[i] / NumberOfStudents);
    }
    /*
    printf("科目一总分为:%.2lf,平均分为:%.2lf\n",EverySubjectTotal[Subject_1],EverySubjectTotal[Subject_1] / NumberOfStudents);
    printf("科目二总分为:%.2lf,平均分为:%.2lf\n",EverySubjectTotal[Subject_2],EverySubjectTotal[Subject_2] / NumberOfStudents);
    printf("科目三总分为:%.2lf,平均分为:%.2lf\n",EverySubjectTotal[Subject_3],EverySubjectTotal[Subject_3] / NumberOfStudents);
    printf("科目四总分为:%.2lf,平均分为:%.2lf\n",EverySubjectTotal[Subject_4],EverySubjectTotal[Subject_4] / NumberOfStudents);
    printf("科目五总分为:%.2lf,平均分为:%.2lf\n",EverySubjectTotal[Subject_5],EverySubjectTotal[Subject_5] / NumberOfStudents);
    printf("科目六总分为:%.2lf,平均分为:%.2lf\n",EverySubjectTotal[Subject_6],EverySubjectTotal[Subject_6] / NumberOfStudents);
    */
}

void CaclEveryStudent()
{
    system("cls");
    if(node_head == NULL)
    {
        printf("找不到学生信息，请先输入!\n");
        return;
    }
    int i = 0;
    Node *p = node_head;
    while(p != NULL)
    {
        p->aStudent.total = 0.0;
        p->aStudent.average = 0.0;
        for(i = 0; i < 6; i++)
        {
            p->aStudent.total += p->aStudent.score[i];
        }
        p->aStudent.average = p->aStudent.total / NumberOfSubjects;
        p = p->Next;
    }

}

boolean Ascending(double a,double b)
{
    return a < b;
}

boolean Descending(double a,double b)
{
    return a > b;
}
Node *Sort(Node *head,boolean (*comparator)(double a,double b))
{
    Node *pFirst;		//新链表的头节点
    Node *pTail;		//新链表的尾节点
    Node *pMinBefore;	//保留键值更小的节点的前驱结点的指针
    Node *pMin;			//存储当前键值最小的节点
    Node *p;			//当前正在操作的节点

    pFirst = NULL;
    while(head != NULL)
    {
        for (p = head, pMin = head; p->Next != NULL; p = p->Next) 			//循环遍历链表中的节点，找出此时最小的节点
        {
            if((*comparator)(p->Next->aStudent.total,pMin->aStudent.total))
            {
                pMinBefore = p;
                pMin = p->Next;
            }
        }
        //结束循环后，首先将当前找到的最小（大）节点放入有序链表中，然后再分情况处理原链表的节点

        //将当前最小（大）节点放入有序链表
        if (pFirst == NULL)     //如果有序链表目前还是一个空链表
        {
            pFirst = pMin;      // 第一次找到键值最小的节点
            pTail  = pMin;      // 注意：尾指针让它指向最后的一个节点
        }
        else                    // 有序链表中已经有节点
        {
            pTail->Next = pMin; // 把刚找到的最小节点放到最后，即让尾指针的next指向它
            pTail = pMin;       // 尾指针也要指向它
        }

        //处理原链表
        if (pMin == head)        //如果找到的最小节点就是第一个节点
        {
            head = head->Next;   // 显然让head指向原head->next,即第二个节点
        }
        else /*如果不是第一个节点*/
        {
            pMinBefore->Next = pMin->Next; //前次最小节点的next指向当前pmin的next,这样就让pmin离开了原链表
        }
    }
    if (pFirst != NULL)     /*循环结束得到有序链表first                */
    {
        pTail->Next = NULL; /*单向链表的最后一个节点的next应该指向NULL */
    }
    head = pFirst;
    return head;
}

Node *SortByNumber(Node *head)
{
    Node *pFirst;		//新链表的头节点
    Node *pTail;		//新链表的尾节点
    Node *pMinBefore;	//保留键值更小的节点的前驱结点的指针
    Node *pMin;			//存储当前键值最小的节点
    Node *p;			//当前正在操作的节点

    pFirst = NULL;
    while(head != NULL)
    {
        for (p = head, pMin = head; p->Next != NULL; p = p->Next) 			//循环遍历链表中的节点，找出此时最小的节点
        {
            if(p->Next->aStudent.id < pMin->aStudent.id)
            {
                pMinBefore = p;
                pMin = p->Next;
            }
        }
        //结束循环后，首先将当前找到的最小（大）节点放入有序链表中，然后再分情况处理原链表的节点

        //将当前最小（大）节点放入有序链表
        if (pFirst == NULL)     //如果有序链表目前还是一个空链表
        {
            pFirst = pMin;      // 第一次找到键值最小的节点
            pTail  = pMin;      // 注意：尾指针让它指向最后的一个节点
        }
        else                    // 有序链表中已经有节点
        {
            pTail->Next = pMin; // 把刚找到的最小节点放到最后，即让尾指针的next指向它
            pTail = pMin;       // 尾指针也要指向它
        }

        //处理原链表
        if (pMin == head)        //如果找到的最小节点就是第一个节点
        {
            head = head->Next;   // 显然让head指向原head->next,即第二个节点
        }
        else /*如果不是第一个节点*/
        {
            pMinBefore->Next = pMin->Next; //前次最小节点的next指向当前pmin的next,这样就让pmin离开了原链表
        }
    }
    if (pFirst != NULL)     /*循环结束得到有序链表first                */
    {
        pTail->Next = NULL; /*单向链表的最后一个节点的next应该指向NULL */
    }
    head = pFirst;
    return head;
}
Node *SortByName(Node* head)
{
    Node *pFirst;		//新链表的头节点
    Node *pTail;		//新链表的尾节点
    Node *pMinBefore = NULL;	//保留键值更小的节点的前驱结点的指针
    Node *pMin;			//存储当前键值最小的节点
    Node *p;			//当前正在操作的节点

    pFirst = NULL;
    while(head != NULL)
    {
        for (p = head, pMin = head; p->Next != NULL; p = p->Next) 			//循环遍历链表中的节点，找出此时最小的节点
        {
            if(strcmp(p->aStudent.name,p->aStudent.name) < 0)
            {
                pMinBefore = p;
                pMin = p->Next;
            }
        }
        //结束循环后，首先将当前找到的最小（大）节点放入有序链表中，然后再分情况处理原链表的节点

        //将当前最小（大）节点放入有序链表
        if (pFirst == NULL)     //如果有序链表目前还是一个空链表
        {
            pFirst = pMin;      // 第一次找到键值最小的节点
            pTail  = pMin;      // 注意：尾指针让它指向最后的一个节点
        }
        else                    // 有序链表中已经有节点
        {
            pTail->Next = pMin; // 把刚找到的最小节点放到最后，即让尾指针的next指向它
            pTail = pMin;       // 尾指针也要指向它
        }

        //处理原链表
        if (pMin == head)        //如果找到的最小节点就是第一个节点
        {
            head = head->Next;   // 显然让head指向原head->next,即第二个节点
        }
        else /*如果不是第一个节点*/
        {
            pMinBefore->Next = pMin->Next; //前次最小节点的next指向当前pmin的next,这样就让pmin离开了原链表
        }
    }
    if (pFirst != NULL)     /*循环结束得到有序链表first                */
    {
        pTail->Next = NULL; /*单向链表的最后一个节点的next应该指向NULL */
    }
    head = pFirst;
    return head;
}
void SearchByNumber()
{
    int NumberToSearch;
    printf("请输入查找的学号:\n");
    scanf("%d",&NumberToSearch);

    Node *p = node_head;
    while(p != NULL && p->aStudent.id != NumberToSearch)
    {
        p = p->Next;
    }
    if(p == NULL)
    {
        printf("没有找到该学号对应的学生！\n");
    }
    else
    {
        printf("姓名:%s\t学号:%d\t总分:%.2lf\n",p->aStudent.name,p->aStudent.id,p->aStudent.total);
    }
}

void SearchByName()
{
    char NameToSearch[MAX_NAME_LENGTH];
    printf("请输入要查找的名字:\n");
    scanf("%s",NameToSearch);

    Node *p = node_head;
    while(p != NULL && strcmp(p->aStudent.name, NameToSearch) != 0)
    {
        p = p->Next;
    }
    if(p == NULL)
    {
        printf("没有找到该学生！\n");
    }
    else
    {
        printf("姓名:%s\t学号:%d\t总分:%.2lf\n",p->aStudent.name,p->aStudent.id,p->aStudent.total);
    }
}
void Statistic()
{
    int StatisticsArray[6][5] = {{0},{0},{0},{0},{0},{0}};            //此二维数组的6行表示6门科目，5列代表五种状态。
    Node *p = node_head;
    int i;
    while(p != NULL)
    {
        for(i = 0; i < 6; i++)
        {
            if(p->aStudent.score[i] >= 90 && p->aStudent.score[i] <= 100)
                StatisticsArray[i][Excellent]++;
            else if(p->aStudent.score[i] >= 80 && p->aStudent.score[i] < 90)
                StatisticsArray[i][Well]++;
            else if(p->aStudent.score[i] >= 70 && p->aStudent.score[i] < 80)
                StatisticsArray[i][Medium]++;
            else if(p->aStudent.score[i] >= 60 && p->aStudent.score[i] < 70)
                StatisticsArray[i][Pass]++;
            else
                StatisticsArray[i][Fail]++;
        }
        p = p->Next;
    }
    for(i = 0;i < NumberOfSubjects;i++)
    {
        printf("科目%d优秀人数：%d, 占比：%.2lf\n",i + 1,StatisticsArray[i][Excellent],((double)StatisticsArray[i][Excellent]) / NumberOfStudents) ;
        printf("科目%d良好人数：%d, 占比：%.2lf\n",i + 1,StatisticsArray[i][Well],((double)StatisticsArray[i][Well]) / NumberOfStudents);
        printf("科目%d中等人数：%d, 占比：%.2lf\n",i + 1,StatisticsArray[i][Medium],((double)StatisticsArray[i][Medium]) / NumberOfStudents);
        printf("科目%d通过人数：%d, 占比：%.2lf\n",i + 1,StatisticsArray[i][Pass],((double)StatisticsArray[i][Pass]) / NumberOfStudents);
        printf("科目%d不及格人数：%d, 占比：%.2lf\n",i + 1,StatisticsArray[i][Fail],((double)StatisticsArray[i][Fail]) / NumberOfStudents);

    }
    /*
    printf("科目一优秀人数：%d, 占比：%.2lf\n",StatisticsArray[Subject_1][Excellent],((double)StatisticsArray[Subject_1][Excellent]) / NumberOfStudents) ;
    printf("科目一良好人数：%d, 占比：%.2lf\n",StatisticsArray[Subject_1][Well],((double)StatisticsArray[Subject_1][Well]) / NumberOfStudents);
    printf("科目一中等人数：%d, 占比：%.2lf\n",StatisticsArray[Subject_1][Medium],((double)StatisticsArray[Subject_1][Medium]) / NumberOfStudents);
    printf("科目一通过人数：%d, 占比：%.2lf\n",StatisticsArray[Subject_1][Pass],((double)StatisticsArray[Subject_1][Pass]) / NumberOfStudents);
    printf("科目一不及格人数：%d, 占比：%.2lf\n",StatisticsArray[Subject_1][Fail],((double)StatisticsArray[Subject_1][Fail]) / NumberOfStudents);

    printf("科目二优秀人数：%d, 占比：%.2lf\n",StatisticsArray[Subject_2][Excellent],((double)StatisticsArray[Subject_2][Excellent]) / NumberOfStudents) ;
    printf("科目二良好人数：%d, 占比：%.2lf\n",StatisticsArray[Subject_2][Well],((double)StatisticsArray[Subject_2][Well]) / NumberOfStudents);
    printf("科目二中等人数：%d, 占比：%.2lf\n",StatisticsArray[Subject_2][Medium],((double)StatisticsArray[Subject_2][Medium]) / NumberOfStudents);
    printf("科目二通过人数：%d, 占比：%.2lf\n",StatisticsArray[Subject_2][Pass],((double)StatisticsArray[Subject_2][Pass]) / NumberOfStudents);
    printf("科目二不及格人数：%d, 占比：%.2lf\n",StatisticsArray[Subject_2][Fail],((double)StatisticsArray[Subject_2][Fail]) / NumberOfStudents);

    printf("科目三优秀人数：%d, 占比：%.2lf\n",StatisticsArray[Subject_3][Excellent],((double)StatisticsArray[Subject_3][Excellent]) / NumberOfStudents) ;
    printf("科目三良好人数：%d, 占比：%.2lf\n",StatisticsArray[Subject_3][Well],((double)StatisticsArray[Subject_3][Well]) / NumberOfStudents);
    printf("科目三中等人数：%d, 占比：%.2lf\n",StatisticsArray[Subject_3][Medium],((double)StatisticsArray[Subject_3][Medium]) / NumberOfStudents);
    printf("科目三通过人数：%d, 占比：%.2lf\n",StatisticsArray[Subject_3][Pass],((double)StatisticsArray[Subject_3][Pass]) / NumberOfStudents);
    printf("科目三不及格人数：%d, 占比：%.2lf\n",StatisticsArray[Subject_3][Fail],((double)StatisticsArray[Subject_3][Fail]) / NumberOfStudents);

    printf("科目四优秀人数：%d, 占比：%.2lf\n",StatisticsArray[Subject_4][Excellent],((double)StatisticsArray[Subject_4][Excellent]) / NumberOfStudents) ;
    printf("科目四良好人数：%d, 占比：%.2lf\n",StatisticsArray[Subject_4][Well],((double)StatisticsArray[Subject_4][Well]) / NumberOfStudents);
    printf("科目四中等人数：%d, 占比：%.2lf\n",StatisticsArray[Subject_4][Medium],((double)StatisticsArray[Subject_4][Medium]) / NumberOfStudents);
    printf("科目四通过人数：%d, 占比：%.2lf\n",StatisticsArray[Subject_4][Pass],((double)StatisticsArray[Subject_4][Pass]) / NumberOfStudents);
    printf("科目四不及格人数：%d, 占比：%.2lf\n",StatisticsArray[Subject_4][Fail],((double)StatisticsArray[Subject_4][Fail]) / NumberOfStudents);

    printf("科目五优秀人数：%d, 占比：%.2lf\n",StatisticsArray[Subject_5][Excellent],((double)StatisticsArray[Subject_5][Excellent]) / NumberOfStudents) ;
    printf("科目五良好人数：%d, 占比：%.2lf\n",StatisticsArray[Subject_5][Well],((double)StatisticsArray[Subject_5][Well]) / NumberOfStudents);
    printf("科目五中等人数：%d, 占比：%.2lf\n",StatisticsArray[Subject_5][Medium],((double)StatisticsArray[Subject_5][Medium]) / NumberOfStudents);
    printf("科目五通过人数：%d, 占比：%.2lf\n",StatisticsArray[Subject_5][Pass],((double)StatisticsArray[Subject_5][Pass]) / NumberOfStudents);
    printf("科目五不及格人数：%d, 占比：%.2lf\n",StatisticsArray[Subject_5][Fail],((double)StatisticsArray[Subject_5][Fail]) / NumberOfStudents);

    printf("科目六优秀人数：%d, 占比：%.2lf\n",StatisticsArray[Subject_6][Excellent],((double)StatisticsArray[Subject_6][Excellent]) / NumberOfStudents) ;
    printf("科目六良好人数：%d, 占比：%.2lf\n",StatisticsArray[Subject_6][Well],((double)StatisticsArray[Subject_6][Well]) / NumberOfStudents);
    printf("科目六中等人数：%d, 占比：%.2lf\n",StatisticsArray[Subject_6][Medium],((double)StatisticsArray[Subject_6][Medium]) / NumberOfStudents);
    printf("科目六通过人数：%d, 占比：%.2lf\n",StatisticsArray[Subject_6][Pass],((double)StatisticsArray[Subject_6][Pass]) / NumberOfStudents);
    printf("科目六不及格人数：%d, 占比：%.2lf\n",StatisticsArray[Subject_6][Fail],((double)StatisticsArray[Subject_6][Fail]) / NumberOfStudents);
    */
}
void ListRecord()
{
    Node *p = node_head;
    int i;
    while(p != NULL)
    {
        printf("姓名:%s\t学号:%d\t总分:%.2lf\t平均分:%.2lf\n",p->aStudent.name,p->aStudent.id,p->aStudent.total,p->aStudent.average);
        for(i = 0; i < NumberOfSubjects; i++)
        {
            printf("第%d门成绩:%.2lf\t",(i + 1),p->aStudent.score[i]);
        }
        printf("\n");
        p = p->Next;
    }
}

void Write()
{
    Node *p = node_head;
    char src[500];
    printf("请输入要写入的文件的路径:\n");
    scanf("%s",src);
    FILE *file =  fopen(src,"ab");
    if(file == NULL)
    {
        printf("文件打开失败!\n");
        return ;
    }
    while(p != NULL)
    {
        fprintf(file,"%d\t%s\t%.2lf\t%.2lf\t%.2lf\t%.2lf\t%.2lf\t%.2lf\t%.2lf\t%.2lf\n",p->aStudent.id,p->aStudent.name,p->aStudent.total,p->aStudent.average,p->aStudent.score[Subject_1],p->aStudent.score[Subject_2],p->aStudent.score[Subject_3],p->aStudent.score[Subject_4],p->aStudent.score[Subject_5],p->aStudent.score[Subject_6]);
        p = p->Next;
    }
    printf("写入成功!\n");
    fclose(file);
}

void Read()
{
    NumberOfStudents = 0;
    Node *p;
    char src[500];
    printf("请输入要读取的文件的路径:\n");
    scanf("%s",src);
    printf("请输入课程门数:\n");
    scanf("%d",&NumberOfSubjects);
    FILE *file =  fopen(src,"r");
    if(file == NULL)
    {
        printf("文件打开失败!\n");
        return ;
    }
    DeleteLinkList();
    while(!feof(file))
    {
        Node *Stu = (Node*)malloc(sizeof(Node));
        fscanf(file,"%d\t%s\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\n",&Stu->aStudent.id,Stu->aStudent.name,&Stu->aStudent.total,&Stu->aStudent.average,
                                                                                    &Stu->aStudent.score[Subject_1],&Stu->aStudent.score[Subject_2],&Stu->aStudent.score[Subject_3],
                                                                                    &Stu->aStudent.score[Subject_4],&Stu->aStudent.score[Subject_5],&Stu->aStudent.score[Subject_6]);
        NumberOfStudents++;
        if(node_head == NULL)
        {
            node_head = Stu;
            p = node_head;
            p->Next = NULL;
        }
        else
        {
            p->Next = Stu;
            p = p->Next;
            p->Next = NULL;
        }
    }
    fclose(file);
    printf("读取成功!\n");
}

void DeleteLinkList()
{
    if(node_head == NULL)
        return;
    Node *p = node_head;
    Node *temp = p;
    while(temp != NULL)
    {
        p = p->Next;
        free(temp);
        temp = p;
    }
    node_head = NULL;
}
